package mao.concurent.consumer;

import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author Totoro
 * @date 2020/7/8
 * @explain:
 */
public class Producer<T> implements Runnable {
    private static AtomicInteger count = new AtomicInteger(0);
    private static Random random = new Random(47);

    private MyConcurrentQueue<T> queue;
    private int id = count.incrementAndGet();

    //可以传进来生成器。
    public Producer(MyConcurrentQueue<T> queue) {
        this.queue = queue;
    }

    @Override
    public void run() {
        while (!Thread.currentThread().isInterrupted()){


        }
    }

    @Override
    public String toString() {
        return "Producer{" +
                "id=" + id +
                '}';
    }
}
